<template>
	<view class="custom--model">
		<!-- 自定义模态框  联系客服-->
		<u-overlay :show="show" opacity="0.6">
			<view class="warp">
				<view class="po-re" :style="{top:top}"
					style="width:600rpx ;box-sizing:border-box;min-height:250rpx;border-radius: 16rpx;background-color: #ffffff;overflow: hidden;">
					<view class="po-ab w-100 b-box p-x-30" @click="Close"
						style="right: 42rpx;top:30rpx;width: 20rpx;height: 20rpx;" v-if="showCloseIcon">
						<text style="font-size: 42rpx;color: #666666;">×</text>
					</view>
					<!-- 标题 -->
					<view class="d-flex flex-c ali-i-c just-c b-box p-x-30" v-if="title" style="margin: 52rpx 0 40rpx;">
						<text style="font: 500 40rpx PingFang SC;color: #000000;margin-left: 20rpx;">{{title}}</text>
					</view>
					<!-- 输入框 -->
					<view  class=" w-100 d-flex flex-r ali-i-c just-c b-box" style="margin-bottom: 52rpx;">
						<view style="width:494rpx"> 
							<u-input border="none" placeholder="Dimple、"
								:customStyle="{color:'#222222',font:'400 28rpx PingFang SC',background:'#f5f5f5',height:'80rpx',boxSizing:'border-box',padding:'0 32rpx'}"
								:placeholderStyle="{color:'#aaaaaa',fontWeight: '400',fontsize:'28px',fontfamily: 'PingFang SC-Regular, PingFang SC'}"
								></u-input>
						</view>
					</view>
					<!-- 按钮 -->
					<view style="width: 100%;border-top: 2rpx solid #f1f1f1;"
						:style="{justifyContent:cancelText?'space-between':'center'}"
						class="d-flex flex-r ali-i-c just-sw b-box">
						<!-- 取消 -->
						<view v-if="cancelText" class="d-flex flex-r ali-i-c just-c" @click="cancel"
							:style="{color:Cancelcolor,height:height}" style="flex: 1;">
							<text style="font:400 28rpx PingFang SC;">{{cancelText}}</text>
						</view>
						<!-- 确定 -->
						<view v-if="confirmText" class="d-flex flex-r ali-i-c just-c" @click="confirm"
							:style="{color:color,height:height}"
							style="background: #ffffff;flex: 1;border-left: 2rpx solid #f1f1ff;">
							<text style="font:400 28rpx PingFang SC;">{{confirmText}}</text>
						</view>
					</view>
				</view>
			</view>

		</u-overlay>
	</view>
</template>

<script>
	import Uinput from '../../components/uview-ui/components/u-input/u-input';
	export default {
		name: "custom-model",
		components:{
			'u-input': Uinput
		},
		props: {
			top: {
				type: String,
				default: '0rpx'
			},
			title: {
				type: String,
				default: ''
			},
			
			show: {
				type: Boolean,
				default: false
			},
			confirmText: {
				type: String,
				default: '确定'
			},
			showCloseIcon: {
				type: Boolean,
				default: false,
			},
			cancelText: {
				type: String,
				default: '取消'
			},
			
			borderColor: {
				type: String,
				default: '1rpx solid #26387C'
			},
			color: {
				type: String,
				default: '#26387C'
			},
			CancelborderColor: {
				type: String,
				default: '2rpx solid #DDDDDD'
			},
			Cancelcolor: {
				type: String,
				default: '#333333'
			},
			height: {
				type: String,
				default: '60rpx'
			},
			width: {
				type: String,
				default: '260rpx'
			}
		},
		data() {
			return {

			};
		},
		methods: {
			Close() {
				this.$parent.ModelCancel();
			},
			confirm() {
				this.$emit('confirm', 1)

			},
			cancel() {
				this.$emit('cancel', 0)

			}
		}
	}
</script>

<style lang="scss">
	.custom--model {
		.warp {
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: row;
			height: 100%;
		}


	}
</style>
